package com.mw.job.ui.zookeeper;

import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by mengdexuan on 2017/10/12 16:25.
 */
public class SessionConnectionStateListener implements ConnectionStateListener{

	private static Logger log = LoggerFactory.getLogger(SessionConnectionStateListener.class);

	@Override
	public void stateChanged(CuratorFramework curatorFramework, ConnectionState connectionState) {

		if(ConnectionState.RECONNECTED==connectionState||ConnectionState.CONNECTED==connectionState){
			log.info("连接到ZK服务器！");
		}

	}
}
